package Meituan.Feature;

import com.google.common.base.Splitter;
import org.apache.commons.lang3.StringUtils;

import java.util.List;

/**
 * 特征格式化
 * 以sg_mkt开发，
 * @author: leiwenkang
 * @date: 2020/4/24
 * @time: 15:49
 */
public class FeatureFormat {
    public static void main(String[] args) {
        String str = "CONTEXT_DAY_OF_WEEK:0\n" +
                "    CONTEXT_IS_DAY_OF_WEEK_END:1\n" +
                "    SG_CLICK_KONGKIM_ALL_CK_7DAYS:2\n" +
                "    SG_CLICK_KONGKIM_ALL_CK_30DAYS:3\n" +
                "    SG_CLICK_KONGKIM_ALL_CK_90DAYS:4\n" +
                "    SG_CLICK_KONGKIM_ALL_CK_RATE_7_30DAYS:5\n" +
                "    SG_CLICK_KONGKIM_ALL_CK_RATE_30_90DAYS:6\n" +
                "    SG_CLICK_KONGKIM_ALL_CK_RATE_7_90DAYS:7\n" +
                "    USER_UPS_MT_AGE:8\n" +
                "    USER_UPS_MT_GENDER:9\n" +
                "    USER_UPS_MT_IS_STUDENT:10\n" +
                "    USER_UPS_MT_IS_WHITE_COLLAR:11\n" +
                "    USER_UPS_MT_EDU_LEVEL:12\n" +
                "    USER_UPS_MT_SALARY_LEVEL:13\n" +
                "    USER_UPS_MT_MARITAL_STATUS:14\n" +
                "    USER_UPS_MT_HAVE_CHILD:15\n" +
                "    USER_UPS_MT_CONSUME_STYLE:16\n" +
                "    USER_WAIMAI_END_ORDER_SOURCE:17\n" +
                "    USER_WAIMAI_CNT_7DAYS:18\n" +
                "    USER_WAIMAI_CNT_30DAYS:19\n" +
                "    USER_WAIMAI_CNT_90DAYS:20\n" +
                "    USER_WAIMAI_END_ORDER_DT:21\n" +
                "    USER_WAIMAI_FIRST_ORDER_DT:22\n" +
                "    USER_WAIMAI_END_AOR_TYPE:23\n" +
                "    USER_WAIMAI_FIRST_AOR_TYPE:24\n" +
                "    USER_WAIMAI_DATE_FST_TO_NOW:25\n" +
                "    USER_WAIMAI_DATE_END_TO_NOW:26\n" +
                "    USER_WAIMAI_DAZHONGAPP:27\n" +
                "    USER_WAIMAI_ELEME:28\n" +
                "    USER_WAIMAI_MEITUANWAIMAI:29\n" +
                "    USER_WAIMAI_MEITUANAPP:30\n" +
                "    USER_WAIMAI_JDDJAPP:31\n" +
                "    USER_WAIMAI_CHURN_RATE:32\n" +
                "    USER_WAIMAI_ORD_NUM_TOTAL:33\n" +
                "    USER_WAIMAI_ORD_AMT_TOTAL:34\n" +
                "    USER_WAIMAI_PAY_AMT_TOTAL:35\n" +
                "    USER_WAIMAI_MAX_PRICE:36\n" +
                "    USER_WAIMAI_MIN_PRICE:37\n" +
                "    USER_WAIMAI_WEEKEND_MIN_PRICE:38\n" +
                "    USER_WAIMAI_AVG_SUB_ORD_AMT_TOTAL:39\n" +
                "    USER_WAIMAI_AVG_ORD_AMT:40\n" +
                "    USER_WAIMAI_AVG_PAY_AMT:41\n" +
                "    USER_WAIMAI_AVG_ORD_NUM_7DAYS:42\n" +
                "    USER_WAIMAI_AVG_ORD_NUM_30DAYS:43\n" +
                "    USER_WAIMAI_AVG_ORD_NUM_90DAYS:44\n" +
                "    USER_WAIMAI_ALPHAU2_FLAG:45\n" +
                "    USER_WAIMAI_COUNT_NOFEE_ORDER_NUM:46\n" +
                "    USER_WAIMAI_ACT_COST_RATE:47\n" +
                "    USER_WAIMAI_IS_RECEIVE_RED_7DAYS:48\n" +
                "    USER_WAIMAI_IS_CHEAT:49\n" +
                "    USER_WAIMAI_CANCEL_ORD_TOTAL_RATE:50\n" +
                "    SG_AOR_NEW_UV:51\n" +
                "    SG_AOR_SG_FIRST_ORD_UV:52\n" +
                "    SG_AOR_CONVERSION_RATE:53\n" +
                "    SG_AOR_CITY_NEW_UV:54\n" +
                "    SG_AOR_CITY_SG_FIRST_ORD_UV:55\n" +
                "    SG_AOR_CITY_CONVERSION_RATE:56\n" +
                "    SG_AOR_CITY_CONVERSION_RATIO:57\n" +
                "    SG_AOR_RATIO_PERCENT:58\n" +
                "    SG_AOR_CAC:59\n" +
                "    SG_AOR_ORDER_UV:60\n" +
                "    SG_AOR_DISCOUNT_AMT:61\n" +
                "    SG_AOR_POI_CHARGE_AMT:62\n" +
                "    SG_AOR_AGENT_CHARGE_AMT:63\n" +
                "    SG_AOR_NMD_CHARGE_AMT:64\n" +
                "    SG_AOR_OUTER_CHANNEL_CHARGE_AMT:65\n" +
                "    SG_AOR_SG_CHARGE_AMT:66\n" +
                "    SG_AOR_ORIGINAL_PRICE:67\n" +
                "    SG_AOR_ACTUAL_PRICE:68\n" +
                "    SG_AOR_POI_NUM:69\n" +
                "    SG_CITY_CAC:70\n" +
                "    SG_CITY_POI_RATE:71\n" +
                "    SG_CITY_MTDP_RATE:72\n" +
                "    SG_CITY_SG_RATE:73\n" +
                "    SG_CITY_ORDER_UV:74\n" +
                "    SG_CITY_DISCOUNT_AMT:75\n" +
                "    SG_CITY_POI_CHARGE_AMT:76\n" +
                "    SG_CITY_AGENT_CHARGE_AMT:77\n" +
                "    SG_CITY_NMD_CHARGE_AMT:78\n" +
                "    SG_CITY_OUTER_CHANNEL_CHARGE_AMT:79\n" +
                "    SG_CITY_SG_CHARGE_AMT:80\n" +
                "    SG_CITY_ORIGINAL_PRICE:81\n" +
                "    SG_CITY_ACTUAL_PRICE:82\n" +
                "    SG_CITY_POI_NUM:83\n" +
                "    SG_CITY_AOR_NUM:84\n" +
                "    USER_UPS_SEARCH_CNT_IN_3_MONTH:85\n" +
                "    USER_UPS_SEARCH_CNT_IN_2_MONTH:86\n" +
                "    USER_UPS_SEARCH_CNT_IN_1_MONTH:87\n" +
                "    USER_UPS_SEARCH_CNT_IN_2_WEEK:88\n" +
                "    USER_UPS_SEARCH_CNT_IN_1_WEEK:89\n" +
                "    USER_UPS_CLICK_CNT_IN_3_MONTH:90\n" +
                "    USER_UPS_CLICK_CNT_IN_2_MONTH:91\n" +
                "    USER_UPS_CLICK_CNT_IN_1_MONTH:92\n" +
                "    USER_UPS_CLICK_CNT_IN_2_WEEK:93\n" +
                "    USER_UPS_CLICK_CNT_IN_1_WEEK:94\n" +
                "    USER_UPS_VIEW_CNT_IN_3_MONTH:95\n" +
                "    USER_UPS_VIEW_CNT_IN_2_MONTH:96\n" +
                "    USER_UPS_VIEW_CNT_IN_1_MONTH:97\n" +
                "    USER_UPS_VIEW_CNT_IN_2_WEEK:98\n" +
                "    USER_UPS_VIEW_CNT_IN_1_WEEK:99\n" +
                "    USER_UPS_ORD_CNT_IN_3_MONTH:100\n" +
                "    USER_UPS_ORD_CNT_IN_2_MONTH:101\n" +
                "    USER_UPS_ORD_CNT_IN_1_MONTH:102\n" +
                "    USER_UPS_ORD_CNT_IN_2_WEEK:103\n" +
                "    USER_UPS_ORD_CNT_IN_1_WEEK:104\n" +
                "    USER_UPS_LATENT_PROB:105\n" +
                "    COUPON_AMOUNT:106\n" +
                "    SG_ENTRY_EXPOSE_PV:107\n" +
                "    SG_ENTRY_CLICK_PV:108\n" +
                "    SG_HOME_PAGE_EXPOSE_PV:109\n" +
                "    SG_SUBMIT_PAGE_EXPOSE_PV:110\n" +
                "    SG_SUBMITTED_PV:111\n" +
                "    USER_WAIMAI_LABEL_R:112\n" +
                "    SG_WORK_DAY_CNT:113\n" +
                "    SG_WEEKEND_AM_DAY_CNT:114\n" +
                "    SG_WEEKEND_PM_DAY_CNT:115\n" +
                "    SG_MORNING_CNT:116\n" +
                "    SG_NIGHT_CNT:117\n" +
                "    USER_WAIMAI_LINGQU_CNT:118\n" +
                "    USER_WAIMAI_LINGQU_COUPON_AMOUNT:119\n" +
                "    USER_WAIMAI_USE_CNT:120\n" +
                "    USER_WAIMAI_USE_COUPON_AMOUNT:121\n" +
                "    USER_WAIMAI_LINGQU_USE_RATE:122\n" +
                "    SG_CLICK_NUM:123\n" +
                "    SG_EXPOSE_NUM:124\n" +
                "    SG_POI_HOME_NUM:125\n" +
                "    SG_P_SUBMIT_ORDER_NUM:126\n" +
                "    SG_AVG_SUBMIT_ORIGINAL_PRICE:127\n" +
                "    SG_SUBMIT_ORD_NUM:128\n" +
                "    SG_PUSH_ORD_NUM:129\n" +
                "    SG_THIRD_CATE_SCORE:130\n" +
                "    SG_KA_SCORE:131\n" +
                "    SG_CKA_SCORE:132\n" +
                "    SG_SANDIAN_SCORE:133\n" +
                "    SG_CAT_20_SCORE:134\n" +
                "    SG_CAT_21_SCORE:135\n" +
                "    SG_CAT_22_SCORE:136\n" +
                "    SG_CAT_1001_SCORE:137\n" +
                "    SG_CAT_5001_SCORE:138\n" +
                "    USER_WAIMAI_WM_SEARCH_CNT_IN_3_MONTH:139\n" +
                "    USER_WAIMAI_WM_SEARCH_CNT_IN_2_MONTH:140\n" +
                "    USER_WAIMAI_WM_SEARCH_CNT_IN_1_MONTH:141\n" +
                "    USER_WAIMAI_WM_SEARCH_CNT_IN_2_WEEK:142\n" +
                "    USER_WAIMAI_WM_SEARCH_CNT_IN_1_WEEK:143\n" +
                "    USER_WAIMAI_WM_VIEW_CNT_IN_3_MONTH:144\n" +
                "    USER_WAIMAI_WM_VIEW_CNT_IN_2_MONTH:145\n" +
                "    USER_WAIMAI_WM_VIEW_CNT_IN_1_MONTH:146\n" +
                "    USER_WAIMAI_WM_VIEW_CNT_IN_2_WEEK:147\n" +
                "    USER_WAIMAI_WM_VIEW_CNT_IN_1_WEEK:148\n" +
                "    USER_WAIMAI_WM_ORD_CNT_IN_3_MONTH:149\n" +
                "    USER_WAIMAI_WM_ORD_CNT_IN_2_MONTH:150\n" +
                "    USER_WAIMAI_WM_ORD_CNT_IN_1_MONTH:151\n" +
                "    USER_WAIMAI_WM_ORD_CNT_IN_2_WEEK:152\n" +
                "    USER_WAIMAI_WM_ORD_CNT_IN_1_WEEK:153\n" +
                "    USER_WAIMAI_WM_ORD_NUM_90DAY:154\n" +
                "    USER_WAIMAI_WM_AVG_PRICE_90DAY:155\n" +
                "    USER_WAIMAI_WM_MEDIAN_PRICE_90DAY:156\n" +
                "    USER_WAIMAI_WM_SUM_AMT_90DAY:157\n" +
                "    USER_WAIMAI_WM_AGGREREDEEM:158\n" +
                "    USER_WAIMAI_WM_ORDER_CNT_180DAYS:159\n" +
                "    USER_UPS_MT_MONTH_ACTIVE:160\n" +
                "    USER_UPS_MT_YEAR_ACTIVE:161\n" +
                "    USER_UPS_MT_MONTH_PAY:162\n" +
                "    USER_UPS_MT_YEAR_PAY:163\n" +
                "    USER_UPS_SENSI_SCORE:164\n" +
                "    USER_UPS_MT_DAOZONG_SCORE:165\n" +
                "    USER_UPS_MT_HOTEL_SCORE:166\n" +
                "    USER_UPS_MT_MAOYAN_SCORE:167\n" +
                "    USER_UPS_MT_WAIMAI_SCORE:168\n" +
                "    USER_UPS_MT_DAOCAN_SCORE:169\n" +
                "    USER_UPS_MT_WAIMAI_P:170\n" +
                "    USER_UPS_MT_IS_TOUCH:171\n" +
                "    USER_UPS_MT_PUSH_SENSITIVITY_SCORE:172\n" +
                "    USER_UPS_CONSUME_WAIMAI_LEVEL:173\n" +
                "    USER_UPS_CONSUME_DAOCAN_LEVEL:174\n" +
                "    USER_UPS_CONSUME_MAOYAN_LEVEL:175\n" +
                "    USER_UPS_CONSUME_ENJOY_LEVEL:176\n" +
                "    USER_UPS_CONSUME_HOTEL_LEVEL:177\n" +
                "    USER_UPS_CONSUME_JINGNEI_LEVEL:178\n" +
                "    USER_UPS_CONSUME_BEAUTY_LEVEL:179\n" +
                "    USER_UPS_CONSUME_TRAFFIC_LEVEL:180\n" +
                "    USER_UPS_CONSUME_PEISONG_LEVEL:181\n" +
                "    USER_UPS_CONSUME_ZHIHU_LEVEL:182\n" +
                "    USER_UPS_CONSUME_MARRIAGE_LEVEL:183\n" +
                "    USER_UPS_CONSUME_JINGWAI_LEVEL:184\n" +
                "    USER_UPS_CONSUME_PINGTAI_LEVEL:185\n" +
                "    USER_UPS_CONSUME_GOUWU_LEVEL:186\n" +
                "    USER_UPS_CONSUME_HOMEEDU_LEVEL:187\n" +
                "    USER_UPS_CONSUME_ZHENGUO_LEVEL:188\n" +
                "    USER_UPS_USER_VALUE_WAIMAI_M_SCORE:189\n" +
                "    USER_UPS_USER_VALUE_WAIMAI_R_SCORE:190\n" +
                "    USER_UPS_USER_VALUE_WAIMAI_F_SCORE:191\n" +
                "    USER_UPS_USER_VALUE_WAIMAI_RE_SCORE:192\n" +
                "    USER_UPS_USER_VALUE_DAOCAN_M_SCORE:193\n" +
                "    USER_UPS_USER_VALUE_DAOCAN_R_SCORE:194\n" +
                "    USER_UPS_USER_VALUE_DAOCAN_F_SCORE:195\n" +
                "    USER_UPS_USER_VALUE_DAOCAN_RE_SCORE:196\n" +
                "    USER_UPS_USER_VALUE_DAOZONG_M_SCORE:197\n" +
                "    USER_UPS_USER_VALUE_DAOZONG_R_SCORE:198\n" +
                "    USER_UPS_USER_VALUE_DAOZONG_F_SCORE:199\n" +
                "    USER_UPS_USER_VALUE_DAOZONG_RE_SCORE:200\n" +
                "    USER_UPS_USER_VALUE_HOTEL_M_SCORE:201\n" +
                "    USER_UPS_USER_VALUE_HOTEL_R_SCORE:202\n" +
                "    USER_UPS_USER_VALUE_HOTEL_F_SCORE:203\n" +
                "    USER_UPS_USER_VALUE_HOTEL_RE_SCORE:204\n" +
                "    USER_UPS_USER_VALUE_MAOYAN_M_SCORE:205\n" +
                "    USER_UPS_USER_VALUE_MAOYAN_R_SCORE:206\n" +
                "    USER_UPS_USER_VALUE_MAOYAN_F_SCORE:207\n" +
                "    USER_UPS_USER_VALUE_MAOYAN_RE_SCORE:208\n" +
                "    USER_PUSH_PUSH_ARRIVE_NUM_1DAY:209\n" +
                "    USER_PUSH_PUSH_CLICK_NUM_1DAY:210\n" +
                "    USER_PUSH_PUSH_ORDER_NUM_1DAY:211\n" +
                "    USER_PUSH_PUSH_CTR_1DAY:212\n" +
                "    USER_PUSH_PUSH_CXR_1DAY:213\n" +
                "    USER_PUSH_PUSH_ARRIVE_NUM_7DAY:214\n" +
                "    USER_PUSH_PUSH_CLICK_NUM_7DAY:215\n" +
                "    USER_PUSH_PUSH_ORDER_NUM_7DAY:216\n" +
                "    USER_PUSH_PUSH_CTR_7DAY:217\n" +
                "    USER_PUSH_PUSH_CXR_7DAY:218\n" +
                "    USER_PUSH_PUSH_ARRIVE_NUM_30DAY:219\n" +
                "    USER_PUSH_PUSH_CLICK_NUM_30DAY:220\n" +
                "    USER_PUSH_PUSH_ORDER_NUM_30DAY:221\n" +
                "    USER_PUSH_PUSH_CTR_30DAY:222\n" +
                "    USER_PUSH_PUSH_CXR_30DAY:223\n" +
                "    USER_PUSH_SG_PUSH_ARRIVE_NUM_1DAY:224\n" +
                "    USER_PUSH_SG_PUSH_CLICK_NUM_1DAY:225\n" +
                "    USER_PUSH_SG_PUSH_ORDER_NUM_1DAY:226\n" +
                "    USER_PUSH_SG_PUSH_CTR_1DAY:227\n" +
                "    USER_PUSH_SG_PUSH_CXR_1DAY:228\n" +
                "    USER_PUSH_SG_PUSH_ARRIVE_NUM_7DAY:229\n" +
                "    USER_PUSH_SG_PUSH_CLICK_NUM_7DAY:230\n" +
                "    USER_PUSH_SG_PUSH_ORDER_NUM_7DAY:231\n" +
                "    USER_PUSH_SG_PUSH_CTR_7DAY:232\n" +
                "    USER_PUSH_SG_PUSH_CXR_7DAY:233\n" +
                "    USER_PUSH_SG_PUSH_ARRIVE_NUM_30DAY:234\n" +
                "    USER_PUSH_SG_PUSH_CLICK_NUM_30DAY:235\n" +
                "    USER_PUSH_SG_PUSH_ORDER_NUM_30DAY:236\n" +
                "    USER_PUSH_SG_PUSH_CTR_30DAY:237\n" +
                "    USER_PUSH_SG_PUSH_CXR_30DAY:238\n" +
                "    USER_WAIMAI_MINE_COUPON_CK_NUM_30DAY:239\n" +
                "    USER_WAIMAI_MINE_CK_NUM_30DAY:240\n" +
                "    USER_WAIMAI_MINE_COUPON_PAGE_NUM_30DAY:241\n" +
                "    USER_WAIMAI_MINE_COUPON_CK_NUM_7DAY:242\n" +
                "    USER_WAIMAI_MINE_CK_NUM_7DAY:243\n" +
                "    USER_WAIMAI_MINE_COUPON_PAGE_NUM_7DAY:244\n" +
                "    USER_WAIMAI_MINE_COUPON_CK_NUM_1DAY:245\n" +
                "    USER_WAIMAI_MINE_CK_NUM_1DAY:246\n" +
                "    USER_WAIMAI_MINE_COUPON_PAGE_NUM_1DAY:247";
        formatFeature(str);

    }

    private static void formatFeature(String str) {
        if (StringUtils.isBlank(str)) {
            return;
        }

        List<String> list = Splitter.on("\n").splitToList(str);
        for (String featureValue: list) {
            List<String> featureValueList = Splitter.on(":").splitToList(featureValue);
            String featureName = featureValueList.get(0).trim();
            if (featureName.startsWith("USER_PUSH")) {
                featureName = featureName.substring(10);
            }
            System.out.println(featureName.toLowerCase() + ":" + "-7000.0");
        }

    }


}
